<?php
class Employee extends ActiveRecord
{
	protected $email;

	/*
	*Check email for exista
	*
	*
	*return boolean: true||false
	*/	
	public function checkMail($email)
	{
		$this->email = $email;
		$result = DB::connect()->createCommand()
							 ->select('id')
							 ->from($this->tableName)
							 ->whereS("`email`='$this->email'")
							 ->getRow();
		if($result)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
}
